package cn.xiangyuanpin.tests;

import cn.xiangyuanpin.pojo.Cart;
import cn.xiangyuanpin.pojo.CartItem;
import cn.xiangyuanpin.service.OrderService;
import cn.xiangyuanpin.service.impl.OrderServiceImpl;
import org.junit.Test;

import java.math.BigDecimal;

import static org.junit.Assert.*;

public class OrderServiceImplTest {
     private OrderService orderService=new OrderServiceImpl();
    @Test
    public void createOrder() {
        Cart cart=new Cart();
        cart.addItem(new CartItem(1,"java",1,new BigDecimal(100),new BigDecimal(100)));
        cart.addItem(new CartItem(1,"java",1,new BigDecimal(100),new BigDecimal(100)));
        cart.addItem(new CartItem(2,"数据结构",1,new BigDecimal(70),new BigDecimal(70)));
        System.out.println(orderService.createOrder(cart,1));
    }
}